package com.meilingcloud.research.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilingcloud.research.domain.RwsQcSample;
import com.meilingcloud.research.mapper.RwsQcSampleMapper;
import com.meilingcloud.research.service.IRwsQcSampleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 质控-样本关联Service业务层处理
 *
 * @author chenl
 * @date 2021-05-10
 */
@Service
public class RwsQcSampleServiceImpl extends ServiceImpl<RwsQcSampleMapper, RwsQcSample> implements IRwsQcSampleService {

    @Override
    public List<RwsQcSample> queryList(RwsQcSample rwsQcSample) {
        LambdaQueryWrapper<RwsQcSample> lqw = Wrappers.lambdaQuery();
        if (rwsQcSample.getQcId() != null) {
            lqw.eq(RwsQcSample::getQcId, rwsQcSample.getQcId());
        }
        if (rwsQcSample.getSampBackupId() != null) {
            lqw.eq(RwsQcSample::getSampBackupId, rwsQcSample.getSampBackupId());
        }
        return this.list(lqw);
    }
}
